<template>
	<view class="index">
        <view class="new_box" style="margin-top: 20upx;">
            <view class="bbox">
                <view class="list-box" v-for="item in seconds" :key="item.id">
                    <view class="list-ed" @click="goDetail(item.id)">
                        <image class="list-img" :src="`/gongyi/common/download?name=${item.pictureUrl}`" mode="aspectFill">
                        </image>
                        <view class="list-right">
<!--                            <view class="list-head" @click="choice(item)">
                                <view :class="[judge(item)?'selde':'noselde']">{{judge(item)?"已报名":"报名"}}<text
                                        :class="[judge(item)?'selde-q':'noselde-q']"></text></view>
                                <text v-if="item.userId == userInfo.id" style="display:inline-flex;padding: 0upx 0upx 0upx;lihe-height: 1.6;color: #fa436a;font-size: 24upx;">我发布的的活动</text>
                            </view> -->
                            <view class="list-name" style="margin-top: 20px;">{{item.name}}</view>
                            <!-- <text>{{item.textMessage}}</text> -->
                            <view class="list-da">地址：{{item.address}}</view>
                            <view class="list-da">价格：{{item.price}}</view>
                            <view class="list-da">发布时间：<text>{{item.createTime}}</text></view>
                        </view>
                    </view>
                </view>
            </view>
        </view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				list: [{
						course_id: "001",
						title: "一个很长很长很长的标题一个很长很长很长的标题一个很长很长很长的标题一个很长很长很",
						price:"20元",
						address:"石河子大学南区"
					},
					{
						course_id: "002",
						title: "一个标题",
						price:"20元",
						address:"石河子大学南区"
						
					},
					{
						course_id: "003",
						title: "好好学习天天向上",
						price:"20元",
						address:"石河子大学南区"
					},
				],
				selectId:[],
                seconds:[]
			};
		},
        mounted() {
          this.getAllSeconds();
        },
		methods: {
            async getAllSeconds(){
              await uni.request({
                  url:'/gongyi/second/getAllSeconds',
                  method:'GET',
                  success: (res) => {
                      this.seconds = res.data.seconds;
                      console.log(this.seconds)
                  }
              })  
            },
			goDetail(secId){
				uni.navigateTo({
					url:"/pages/fatie/Idle-market/goods-detail/goods-detail?id="+secId
				})
			}
			
		
		}
	};
</script>

<style>
	page{
		background-color: #eee;
	}
	/* 已选择 */
	.selde {
		border: 1px solid red;
		background: red;
		color: #FFFFFF;
		border-radius: 20upx;
		display: flex;
		flex-direction: row;
		justify-content: center;
		align-items: center;
		font-size: 20upx;
		padding: 0 10upx;
	}

	.selde-q {
		width: 18upx;
		height: 18upx;
		border-radius: 50%;
		background: #FFFFFF;
		margin-left: 6upx;
	}

	/* 未选择 */
	.noselde {
		border: 1px solid #959595;
		background: #FFFFFF;
		color: #959595;
		border-radius: 20upx;
		display: flex;
		flex-direction: row;
		justify-content: center;
		align-items: center;
		font-size: 20upx;
		padding: 0 10upx;
	}

	.noselde-q {
		border: 1px solid #959595;
		width: 16upx;
		height: 16upx;
		border-radius: 50%;
		background: #FFFFFF;
		margin-left: 6upx;
	}
	.list-box {
		display: flex;
		flex-direction: column;
		background-color: #fff;
		margin: 0upx 16upx 16upx 16upx;
		padding: 16upx;
		border-radius: 10upx;
	}

	.list-ed {
		display: flex;
		flex-direction: row;
		justify-content: center;
		align-items: center;
	}

	.list-left {
		margin-right: 16upx;
	}

	.list-img {
		width: 160upx;
		height: 160upx;
		margin: 0upx 16upx 0upx 0upx;
	}

	.list-right {
		display: flex;
		flex-direction: column;
		width: 510upx;
		height: 250upx;
	}

	.list-right-img {
		width: 140upx;
		height: 38upx;
	}

	.noadsop {
		width: 120upx;
		height: 32upx;
	}

	.list-head {
		display: flex;
		justify-content: flex-end;
		margin-bottom: 10upx;
	}

	.list-name {
		margin-top: 10rpx;
		overflow: hidden;
		text-overflow: ellipsis;
		display: -webkit-box;
		-webkit-box-orient: vertical;
		-webkit-line-clamp: 2;
		margin-bottom: 10upx;
	}

	.list-da {
		display: flex;
		flex-direction: row;
		font-size: 26upx;
	}

	.list-da view {
		width: 50%;
	}

	.list-da view text {
		color: red;
	}

	.sure {
		background: #FF6000;
		color: #FFFFFF;
		width: 600upx;
		height: 70upx;
		display: flex;
		justify-content: center;
		align-items: center;
		border-radius: 40upx;
		margin: 60upx auto;
	}
</style>
